const db = require("./db");

function qPromise(sql,params){
    return new Promise((resolve, reject) => {
        db.query(sql, params, (results) => {
            if (results) {
                resolve(results);
            } else {
                reject('查询失败');
            }
        });
    });
}
module.exports={qPromise} ;